home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / prog / mint / duftp / dispatch.c < prev    next >
C/C++ Source or Header  |  1995-06-17  |  3KB  |  99 lines

  1. /*
  2.     DUFTP
  3. */
  4.  
  5. // Dialog Dispatcher (opens dialogs in response to object being clicked on)
  6.  
  7. #include <DULIB.H>
  8. #include "globals.h"
  9. #include "duftp_n.h"
  10.  
  11. short dispatcher(void)
  12. {
  13.     switch(this_ob)
  14.     {
  15.         case About_ftp:
  16.             activate_dialog(About,"About DUftp",DIAL_ROLLUP);
  17.             break;
  18.         case Win_ftp:
  19.             activate_dialog(Mainwindow,"File Transfer",DIAL_ROLLUP);
  20.             break;
  21.         case Win_hosts:
  22.             activate_dialog(Hosts,"FTP Server Bookmarks List",DIAL_ROLLUP);
  23.             break;
  24.         case Mftp_open:
  25.         case Open_new_server:
  26.             sprintf(new_server_path,"/                                                           ");
  27.             sprintf(new_server_address,"                                         ");
  28.             sprintf(new_server_login,"anonymous                                ");
  29.             sprintf(new_server_password,"me@                                       ");
  30.             set_dialog_text(Open_new, Open_new_path,new_server_path);
  31.             set_dialog_text(Open_new, Open_new_name,new_server_address);
  32.             set_dialog_text(Open_new, Open_new_login,new_server_login);
  33.             set_dialog_text(Open_new, Open_new_pass,new_server_password);
  34.             Set_dialog_Kfocus(Open_new, Open_new_name);
  35.             activate_dialog(Open_new,"Open FTP Server",DIAL_NO_CLOSE);
  36.             break;
  37.     }
  38.     return TRUE;
  39. }
  40.  
  41. short destructor(void)
  42. {
  43.     switch(this_ob)
  44.     {
  45.         case Open_new_open:
  46.             close_dialog(Open_new);
  47.             open_new_server();
  48.             break;
  49.         case Open_new_cancel:
  50.             close_dialog(Open_new);
  51.             break;
  52.     }
  53.     return TRUE;
  54. }
  55.  
  56. short Kdispatcher(void)
  57. {
  58.     switch(kc_key)
  59.     {
  60.         case 0x3000:
  61.             activate_dialog(Hosts,"FTP Server Bookmarks List",DIAL_ROLLUP);
  62.             break;
  63.         case 0x2100:
  64.             activate_dialog(Mainwindow,"File Transfer",DIAL_ROLLUP);
  65.             break;
  66.         case 0x1800:
  67.             sprintf(new_server_path,"/                                                            ");
  68.             sprintf(new_server_address,"                                         ");
  69.             sprintf(new_server_login,"anonymous                                ");
  70.             sprintf(new_server_password,"me                                              ");
  71.             set_dialog_text(Open_new, Open_new_name,new_server_address);
  72.             set_dialog_text(Open_new, Open_new_login,new_server_login);
  73.             set_dialog_text(Open_new, Open_new_pass,new_server_password);
  74.             set_dialog_text(Open_new, Open_new_path,new_server_path);
  75.             Set_dialog_Kfocus(Open_new, Open_new_name);
  76.             activate_dialog(Open_new,"Open FTP Server",DIAL_NO_CLOSE);
  77.             break;
  78.     }
  79.     return TRUE;
  80. }
  81.  
  82. short Kdestructor(void)
  83. {
  84.     switch(this_dialog)
  85.     {
  86.         case Open_new:
  87.             switch(kc_key)
  88.             {
  89.                 case 0x1c0d:
  90.                     close_dialog(Open_new);
  91.                     open_new_server();
  92.                     return TRUE;
  93.                     break;
  94.             }
  95.             break;
  96.     }
  97.     return FALSE;
  98. }
  99.